package utils

import (
	"encoding/xml"

	"io/ioutil"
	"log"
	"os"
)

func init() {
	file, err := os.Open(AppPath() + "/setting.xml")

	if err != nil {
		log.Fatal("#setting.xml open error: %v", err)
		return
	}

	defer file.Close()
	var data []byte

	if data, err = ioutil.ReadAll(file); err != nil {
		log.Fatal("#setting.xml read error: %v", err)
		return
	}

	if err = xml.Unmarshal(data, &Setting); err != nil {
		log.Fatal("#setting.xml unmarshal error: %v", err)
		return
	}
}
